Skip to content

Conversation

srinivasreddy
Copy link
Contributor

No description provided.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 91.805% when pulling 0387829 on srinivasreddy:2684 into 9b2753b on pytest-dev:master.

'pytest now uses argparse. "%default" should be'
' changed to "%(default)s" ',
DeprecationWarning,
stacklevel=3)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change looks incorrect, the argument type is used indirectly and the higher level intended to trigger that warning for the method call side

msg = "Raised while trying to determine id of parameter %s at position %d." % (argname, idx)
msg += '\nUpdate your code as this will raise an error in pytest-4.0.'
warnings.warn(msg, DeprecationWarning)
warnings.warn(msg, DeprecationWarning, stacklevel=2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for this one stacklevel is actually not applicable


if newmarks:
warnings.warn(MARK_PARAMETERSET_UNPACKING)
warnings.warn(MARK_PARAMETERSET_UNPACKING, stacklevel=2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in this case stacklevel is also not usable, its a case where its probably more sensible to warn explicit and pass the test around

@RonnyPfannschmidt
Copy link
Member

i should have been more clear with what i meant by review, because simply setting stacklevel=2 everywhere is certainly incorrect

@nicoddemus
Copy link
Member

I agree, unfortunately a few of those will need to use warn_explicit because the origin of the warning is far away from the code that actually generates the warning.

@srinivasreddy
Copy link
Contributor Author

I am closing this.

@nicoddemus
Copy link
Member

Thanks anyway for the effort @srinivasreddy, we appreciate it! 👍

@srinivasreddy srinivasreddy deleted the 2684 branch August 16, 2017 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants